package com.imooc.cloud.mall.practice.cartorder.feign;

import com.imooc.cloud.mall.practice.categoryproduct.model.pojo.Product;
import io.swagger.models.auth.In;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * ClassName: ProductFeignClient
 * Package: com.imooc.cloud.mall.practice.cartorder.feign
 *
 * @Author 马学兴
 * @Create 2024/3/11 14:30
 * @Version 1.0
 * Description:商品feignclient
 */

@FeignClient(value = "cloud-mall-category-product")//让feign找到对应的模块
public interface ProductFeignClient {//获取商品信息
    @GetMapping("/product/detailForFeign")
    Product detailForFeign(@RequestParam Integer id);

    //调用商品服务扣库存
    @PostMapping("/product/updateStock")
    void updateStock(@RequestParam Integer productId,@RequestParam Integer stock);
}
